#pragma once

#include <map>
#include <string>

class Task;
class Statistics
{
public:
	static Statistics* GetInstance(void);

	void StaIt(const Task* task);
	std::string GetStatictics(const Task* task);
private:
	////////////////////////////////////////
	typedef struct
	{
		time_t start;
		int queryNum;
		int wrongCaptchaNum;
		int errorNum;
		int sustainedNum;
	}StaUnit;

	std::map<std::string, StaUnit*> staMap;

private:
	//////////////////////////////////
	// Constructors forbidden.
	static Statistics* instance;
	Statistics() : staMap(){}
	Statistics(const Statistics&){}
	Statistics operator =(const Statistics&){}
};